/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-06-14
 * Time: 19:48
 */
public class Test1 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    System.out.println("柚子");
                    // 先注释掉, 再放开
                    // Thread.yield();
                }
            }
        }, "t1");

        t1.start();

        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    System.out.println("球球");
                }
            }
        }, "t2");

        t2.start();
    }
}





